import type { VNode } from 'vue'
import {
  BwCustomComFrontTypeEnum,
  type BwCustomComDesignInfoModel,
} from '@bitwit/base-com-render'
import type {
  Prop,
  DefineComponent,
  ComponentOptionsMixin,
  WritableComputedOptions,
  CreateComponentPublicInstance,
} from 'vue'

export type BwTypeTypeModule = string | number | boolean | [] | object | null

/** vue 实例 this 模型 */
export type BwVueIns = CreateComponentPublicInstance<
  Record<string, any>,
  {},
  {},
  Record<string, WritableComputedOptions<BwTypeTypeModule>>,
  Record<string, Function>,
  ComponentOptionsMixin,
  ComponentOptionsMixin
>

export interface BwCustomComDesignClassConstructorModel {
  /** 设计信息 */
  designInfo?: BwCustomComDesignInfoModel

  /** 组件运行端 */
  front: BwCustomComFrontTypeEnum
}

/**
 * 表单节点子组件信息模型
 */
export type BwChildrenNodeCallback = (slotInfos: any) => Array<VNode>

/** 自定义组件插槽节点信息 */
export interface BwCurtomComSoltNodeInfo {
  soltName: string

  slotParams?: Record<string, any>
}
